package com.yangst.service.common.util;

import com.yangst.service.common.model.CommonResult;

/**
 * 存放结果
 * Created by YST on 2018/4/13.
 */
public class CommonResultHelper {
    public static CommonResult genResult(Object obj, int retCode, String msg) {
        CommonResult ret = new CommonResult();
        ret.setData(obj);
        ret.setMsg(msg);
        ret.setStatus(retCode);
        return ret;
    }

    public static CommonResult genResult(int retCode, String msg) {
        CommonResult ret = new CommonResult();
        ret.setMsg(msg);
        ret.setStatus(retCode);
        return ret;
    }

    public static CommonResult genResultWithSuccess(Object obj) {
        return genResult(obj, 0, "");
    }

    public static CommonResult genResultWithSuccess() {
        return genResult(0, "");
    }

}
